motion2 2.2.0
Loading...
Searching...
No Matches
motion2.h File Reference

This file contains API for Motion 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"

Go to the source code of this file.

Data Structures

struct  motion2_t
 Motion 2 Click context object. More...
struct  motion2_cfg_t
 Motion 2 Click configuration object. More...

Macros

#define MOTION2_MODULE_ENABLE   0x00
 MikroBUS pin set.
#define MOTION2_MODULE_DISABLE   0x01
#define MOTION2_NO_DETECT_OBJECT   0x00
#define MOTION2_DETECT_OBJECT   0x01
#define MOTION2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  motion2_return_value_t { MOTION2_OK = 0 , MOTION2_ERROR = -1 }
 Motion 2 Click return value data. More...
enum  motion2_detect_state_t { MOTION2_NO_DETECT = 0 , MOTION2_DETECTED }
enum  motion2_pin_state_t { MOTION2_PIN_STATE_LOW = 0 , MOTION2_PIN_STATE_HIGH }

Functions

void motion2_cfg_setup (motion2_cfg_t *cfg)
 Config Object Initialization function.
err_t motion2_init (motion2_t *ctx, motion2_cfg_t *cfg)
 Initialization function.
void motion2_enable (motion2_t *ctx, uint8_t state)
 Enable motion sensor function.
uint8_t motion2_detect_state (motion2_t *ctx)
 Get detection state function.

Detailed Description

This file contains API for Motion 2 Click Driver.

Enumeration Type Documentation

◆ motion2_return_value_t

Motion 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
MOTION2_OK 
MOTION2_ERROR